using System;
using System.Collections.Generic;
using System.Text;

namespace Norm
{
    public enum WhereCompareType
    {
        Like,
        Equals,
        NotEquals,
        LessThan,
        GreaterThan
    }

    public class WhereValue
    {
        public WhereValue() {
            WhereType = WhereCompareType.Equals;
        }
        public WhereValue(WhereCompareType type, object v)
        {
            WhereType = type;
            Value = v;
        }
        public WhereCompareType WhereType;
        public object Value;
        
        public string Operator
        {
            get
            {
                switch (WhereType)
                {
                    case WhereCompareType.Equals:
                        return "=";
                    case WhereCompareType.GreaterThan:
                        return ">";
                    case WhereCompareType.LessThan:
                        return "<";
                    case WhereCompareType.Like:
                        return "like";
                    case WhereCompareType.NotEquals:
                        return "<>";
                    default: throw new Exception.NotValidEnumValue();
                }
            }
        }

        public override string ToString()
        {
            return Value.ToString();
        }
    }
}
